package com.cg.cgms.config;


import com.cg.cgms.interceptors.LoginInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

//添加到容器
@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Autowired
    private LoginInterceptor loginInterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //设置拦截目录
        registry.addInterceptor(loginInterceptor).addPathPatterns("/user/userInfo","/Shop/userlova","/user/collect"
        ,"/user/deleteCollect","/user/findcollect");
    }
}
